﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AudioCore.Biz;
using AudioCore.Entity;

namespace AudioBook.AudioManagement.AudioManage
{
    public partial class PlayAudio : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string strPartID = Request.QueryString[GUIConstants.Common.ID_QUERY];
            int idQuery = 0;
            if (int.TryParse(strPartID, out idQuery))
            {
                ArticlePartBiz bizArticlePart = new ArticlePartBiz();
                ArticlePartEntity enArticlePart = bizArticlePart.GetArticlePartByID(idQuery);
                if (enArticlePart != null)
                {
                    lblPartName.Text = enArticlePart.ArticlePartName;
                    string audioFileUrl=string.Format(GUIConstants.WebPage.AudioPage.AudioFile,idQuery);
                    string embed = "<embed type='application/x-shockwave-flash' wmode='transparent' src='http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl={0}&autoPlay=true' height='240' width='300'></embed>";
                    ltrUrl.Text = string.Format(embed, audioFileUrl);
                }
            }
        }
    }
}
